import getState from "@/api/state";
import { Context } from "@/app-context/main-context";
import HorizontalBarChart from "@/template/HorizontalBarChart/HorizontalBarChart";
import ZuiEchart from "@/template/zuiEchart/zuiEchart";
import React, { useContext } from "react";
import { useEffect } from "react";
import { useState } from "react";

const Actmodule4 = () => {
    const [message, setMessage] = useState("暂无数据");
    const { condition } = useContext(Context)
    const [loading, setLoading] = useState(true);
    const [state, setState] = useState({
        data: []
    })

    useEffect(() => {
        getState({
            state,
            apiUrl: "/cifgp-core-api/actQuery/pieChart",
            condition: { ...condition, cType: "actCareService", },
            setState,
            setLoading,
            setMessage,
        })
    }, [condition])

    return (
        <>
            <HorizontalBarChart
                message={message}
                loading={loading}
                style={{ width: "30%" }}
                sort={"up"}
                heightAuto
                hideBtn
                title="服务关注情况"
                data={[
                    state
                ]}
            />
        </>
    )
}
export default Actmodule4;